#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int cmp(const void* n1, const void* n2)
{
	return *(int*)n1 - *(int*)n2;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int arr[1100] = { 0 };
	int i = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%d", arr + i);
	}
	qsort(arr, n, sizeof(int), cmp);
	int sum = 0;
	for (i = 1; i < n - 1; i++)
	{
		sum += arr[i];
	}
	printf("%.2lf", (double)sum / (n - 2));
	return 0;
}

